{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# columns contining values, not variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "pew = pd.read_csv('../data/pew.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>&lt;$10k</th>\n",
       "      <th>$10-20k</th>\n",
       "      <th>$20-30k</th>\n",
       "      <th>$30-40k</th>\n",
       "      <th>$40-50k</th>\n",
       "      <th>$50-75k</th>\n",
       "      <th>$75-100k</th>\n",
       "      <th>$100-150k</th>\n",
       "      <th>&gt;150k</th>\n",
       "      <th>Don't know/refused</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Agnostic</td>\n",
       "      <td>27</td>\n",
       "      <td>34</td>\n",
       "      <td>60</td>\n",
       "      <td>81</td>\n",
       "      <td>76</td>\n",
       "      <td>137</td>\n",
       "      <td>122</td>\n",
       "      <td>109</td>\n",
       "      <td>84</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Atheist</td>\n",
       "      <td>12</td>\n",
       "      <td>27</td>\n",
       "      <td>37</td>\n",
       "      <td>52</td>\n",
       "      <td>35</td>\n",
       "      <td>70</td>\n",
       "      <td>73</td>\n",
       "      <td>59</td>\n",
       "      <td>74</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Buddhist</td>\n",
       "      <td>27</td>\n",
       "      <td>21</td>\n",
       "      <td>30</td>\n",
       "      <td>34</td>\n",
       "      <td>33</td>\n",
       "      <td>58</td>\n",
       "      <td>62</td>\n",
       "      <td>39</td>\n",
       "      <td>53</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Catholic</td>\n",
       "      <td>418</td>\n",
       "      <td>617</td>\n",
       "      <td>732</td>\n",
       "      <td>670</td>\n",
       "      <td>638</td>\n",
       "      <td>1116</td>\n",
       "      <td>949</td>\n",
       "      <td>792</td>\n",
       "      <td>633</td>\n",
       "      <td>1489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Don’t know/refused</td>\n",
       "      <td>15</td>\n",
       "      <td>14</td>\n",
       "      <td>15</td>\n",
       "      <td>11</td>\n",
       "      <td>10</td>\n",
       "      <td>35</td>\n",
       "      <td>21</td>\n",
       "      <td>17</td>\n",
       "      <td>18</td>\n",
       "      <td>116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Evangelical Prot</td>\n",
       "      <td>575</td>\n",
       "      <td>869</td>\n",
       "      <td>1064</td>\n",
       "      <td>982</td>\n",
       "      <td>881</td>\n",
       "      <td>1486</td>\n",
       "      <td>949</td>\n",
       "      <td>723</td>\n",
       "      <td>414</td>\n",
       "      <td>1529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Hindu</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "      <td>9</td>\n",
       "      <td>11</td>\n",
       "      <td>34</td>\n",
       "      <td>47</td>\n",
       "      <td>48</td>\n",
       "      <td>54</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Historically Black Prot</td>\n",
       "      <td>228</td>\n",
       "      <td>244</td>\n",
       "      <td>236</td>\n",
       "      <td>238</td>\n",
       "      <td>197</td>\n",
       "      <td>223</td>\n",
       "      <td>131</td>\n",
       "      <td>81</td>\n",
       "      <td>78</td>\n",
       "      <td>339</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Jehovah's Witness</td>\n",
       "      <td>20</td>\n",
       "      <td>27</td>\n",
       "      <td>24</td>\n",
       "      <td>24</td>\n",
       "      <td>21</td>\n",
       "      <td>30</td>\n",
       "      <td>15</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Jewish</td>\n",
       "      <td>19</td>\n",
       "      <td>19</td>\n",
       "      <td>25</td>\n",
       "      <td>25</td>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>69</td>\n",
       "      <td>87</td>\n",
       "      <td>151</td>\n",
       "      <td>162</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Mainline Prot</td>\n",
       "      <td>289</td>\n",
       "      <td>495</td>\n",
       "      <td>619</td>\n",
       "      <td>655</td>\n",
       "      <td>651</td>\n",
       "      <td>1107</td>\n",
       "      <td>939</td>\n",
       "      <td>753</td>\n",
       "      <td>634</td>\n",
       "      <td>1328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Mormon</td>\n",
       "      <td>29</td>\n",
       "      <td>40</td>\n",
       "      <td>48</td>\n",
       "      <td>51</td>\n",
       "      <td>56</td>\n",
       "      <td>112</td>\n",
       "      <td>85</td>\n",
       "      <td>49</td>\n",
       "      <td>42</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Muslim</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>23</td>\n",
       "      <td>16</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Orthodox</td>\n",
       "      <td>13</td>\n",
       "      <td>17</td>\n",
       "      <td>23</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47</td>\n",
       "      <td>38</td>\n",
       "      <td>42</td>\n",
       "      <td>46</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Other Christian</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "      <td>11</td>\n",
       "      <td>13</td>\n",
       "      <td>13</td>\n",
       "      <td>14</td>\n",
       "      <td>18</td>\n",
       "      <td>14</td>\n",
       "      <td>12</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Other Faiths</td>\n",
       "      <td>20</td>\n",
       "      <td>33</td>\n",
       "      <td>40</td>\n",
       "      <td>46</td>\n",
       "      <td>49</td>\n",
       "      <td>63</td>\n",
       "      <td>46</td>\n",
       "      <td>40</td>\n",
       "      <td>41</td>\n",
       "      <td>71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Other World Religions</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Unaffiliated</td>\n",
       "      <td>217</td>\n",
       "      <td>299</td>\n",
       "      <td>374</td>\n",
       "      <td>365</td>\n",
       "      <td>341</td>\n",
       "      <td>528</td>\n",
       "      <td>407</td>\n",
       "      <td>321</td>\n",
       "      <td>258</td>\n",
       "      <td>597</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   religion  <$10k  $10-20k  $20-30k  $30-40k  $40-50k  \\\n",
       "0                  Agnostic     27       34       60       81       76   \n",
       "1                   Atheist     12       27       37       52       35   \n",
       "2                  Buddhist     27       21       30       34       33   \n",
       "3                  Catholic    418      617      732      670      638   \n",
       "4        Don’t know/refused     15       14       15       11       10   \n",
       "5          Evangelical Prot    575      869     1064      982      881   \n",
       "6                     Hindu      1        9        7        9       11   \n",
       "7   Historically Black Prot    228      244      236      238      197   \n",
       "8         Jehovah's Witness     20       27       24       24       21   \n",
       "9                    Jewish     19       19       25       25       30   \n",
       "10            Mainline Prot    289      495      619      655      651   \n",
       "11                   Mormon     29       40       48       51       56   \n",
       "12                   Muslim      6        7        9       10        9   \n",
       "13                 Orthodox     13       17       23       32       32   \n",
       "14          Other Christian      9        7       11       13       13   \n",
       "15             Other Faiths     20       33       40       46       49   \n",
       "16    Other World Religions      5        2        3        4        2   \n",
       "17             Unaffiliated    217      299      374      365      341   \n",
       "\n",
       "    $50-75k  $75-100k  $100-150k  >150k  Don't know/refused  \n",
       "0       137       122        109     84                  96  \n",
       "1        70        73         59     74                  76  \n",
       "2        58        62         39     53                  54  \n",
       "3      1116       949        792    633                1489  \n",
       "4        35        21         17     18                 116  \n",
       "5      1486       949        723    414                1529  \n",
       "6        34        47         48     54                  37  \n",
       "7       223       131         81     78                 339  \n",
       "8        30        15         11      6                  37  \n",
       "9        95        69         87    151                 162  \n",
       "10     1107       939        753    634                1328  \n",
       "11      112        85         49     42                  69  \n",
       "12       23        16          8      6                  22  \n",
       "13       47        38         42     46                  73  \n",
       "14       14        18         14     12                  18  \n",
       "15       63        46         40     41                  71  \n",
       "16        7         3          4      4                   8  \n",
       "17      528       407        321    258                 597  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pew"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>variable</th>\n",
       "      <th>value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Agnostic</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Atheist</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Buddhist</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Catholic</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Don’t know/refused</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Evangelical Prot</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Hindu</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Historically Black Prot</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>228</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Jehovah's Witness</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Jewish</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Mainline Prot</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>289</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Mormon</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Muslim</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Orthodox</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Other Christian</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Other Faiths</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Other World Religions</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Unaffiliated</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Agnostic</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Atheist</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Buddhist</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Catholic</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Don’t know/refused</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Evangelical Prot</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Hindu</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>Historically Black Prot</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>244</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Jehovah's Witness</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Jewish</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>Mainline Prot</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Mormon</td>\n",
       "      <td>$10-20k</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>150</th>\n",
       "      <td>Hindu</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>151</th>\n",
       "      <td>Historically Black Prot</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>152</th>\n",
       "      <td>Jehovah's Witness</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>153</th>\n",
       "      <td>Jewish</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>154</th>\n",
       "      <td>Mainline Prot</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>155</th>\n",
       "      <td>Mormon</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>Muslim</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>Orthodox</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>Other Christian</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>Other Faiths</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>Other World Religions</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161</th>\n",
       "      <td>Unaffiliated</td>\n",
       "      <td>&gt;150k</td>\n",
       "      <td>258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>162</th>\n",
       "      <td>Agnostic</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>163</th>\n",
       "      <td>Atheist</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>Buddhist</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>Catholic</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>1489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>Don’t know/refused</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167</th>\n",
       "      <td>Evangelical Prot</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>1529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168</th>\n",
       "      <td>Hindu</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>169</th>\n",
       "      <td>Historically Black Prot</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>339</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>Jehovah's Witness</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>Jewish</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>162</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>Mainline Prot</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>1328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>Mormon</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>Muslim</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>Orthodox</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>Other Christian</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>Other Faiths</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>Other World Religions</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Unaffiliated</td>\n",
       "      <td>Don't know/refused</td>\n",
       "      <td>597</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>180 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                    religion            variable  value\n",
       "0                   Agnostic               <$10k     27\n",
       "1                    Atheist               <$10k     12\n",
       "2                   Buddhist               <$10k     27\n",
       "3                   Catholic               <$10k    418\n",
       "4         Don’t know/refused               <$10k     15\n",
       "5           Evangelical Prot               <$10k    575\n",
       "6                      Hindu               <$10k      1\n",
       "7    Historically Black Prot               <$10k    228\n",
       "8          Jehovah's Witness               <$10k     20\n",
       "9                     Jewish               <$10k     19\n",
       "10             Mainline Prot               <$10k    289\n",
       "11                    Mormon               <$10k     29\n",
       "12                    Muslim               <$10k      6\n",
       "13                  Orthodox               <$10k     13\n",
       "14           Other Christian               <$10k      9\n",
       "15              Other Faiths               <$10k     20\n",
       "16     Other World Religions               <$10k      5\n",
       "17              Unaffiliated               <$10k    217\n",
       "18                  Agnostic             $10-20k     34\n",
       "19                   Atheist             $10-20k     27\n",
       "20                  Buddhist             $10-20k     21\n",
       "21                  Catholic             $10-20k    617\n",
       "22        Don’t know/refused             $10-20k     14\n",
       "23          Evangelical Prot             $10-20k    869\n",
       "24                     Hindu             $10-20k      9\n",
       "25   Historically Black Prot             $10-20k    244\n",
       "26         Jehovah's Witness             $10-20k     27\n",
       "27                    Jewish             $10-20k     19\n",
       "28             Mainline Prot             $10-20k    495\n",
       "29                    Mormon             $10-20k     40\n",
       "..                       ...                 ...    ...\n",
       "150                    Hindu               >150k     54\n",
       "151  Historically Black Prot               >150k     78\n",
       "152        Jehovah's Witness               >150k      6\n",
       "153                   Jewish               >150k    151\n",
       "154            Mainline Prot               >150k    634\n",
       "155                   Mormon               >150k     42\n",
       "156                   Muslim               >150k      6\n",
       "157                 Orthodox               >150k     46\n",
       "158          Other Christian               >150k     12\n",
       "159             Other Faiths               >150k     41\n",
       "160    Other World Religions               >150k      4\n",
       "161             Unaffiliated               >150k    258\n",
       "162                 Agnostic  Don't know/refused     96\n",
       "163                  Atheist  Don't know/refused     76\n",
       "164                 Buddhist  Don't know/refused     54\n",
       "165                 Catholic  Don't know/refused   1489\n",
       "166       Don’t know/refused  Don't know/refused    116\n",
       "167         Evangelical Prot  Don't know/refused   1529\n",
       "168                    Hindu  Don't know/refused     37\n",
       "169  Historically Black Prot  Don't know/refused    339\n",
       "170        Jehovah's Witness  Don't know/refused     37\n",
       "171                   Jewish  Don't know/refused    162\n",
       "172            Mainline Prot  Don't know/refused   1328\n",
       "173                   Mormon  Don't know/refused     69\n",
       "174                   Muslim  Don't know/refused     22\n",
       "175                 Orthodox  Don't know/refused     73\n",
       "176          Other Christian  Don't know/refused     18\n",
       "177             Other Faiths  Don't know/refused     71\n",
       "178    Other World Religions  Don't know/refused      8\n",
       "179             Unaffiliated  Don't know/refused    597\n",
       "\n",
       "[180 rows x 3 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pew.melt(id_vars='religion')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "pew_tidy = pew.melt(id_vars='religion', var_name=\"income\", value_name=\"count\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>religion</th>\n",
       "      <th>income</th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Agnostic</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Atheist</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Buddhist</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Catholic</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Don’t know/refused</td>\n",
       "      <td>&lt;$10k</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             religion income  count\n",
       "0            Agnostic  <$10k     27\n",
       "1             Atheist  <$10k     12\n",
       "2            Buddhist  <$10k     27\n",
       "3            Catholic  <$10k    418\n",
       "4  Don’t know/refused  <$10k     15"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pew_tidy.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "billboard = pd.read_csv('../data/billboard.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>artist</th>\n",
       "      <th>track</th>\n",
       "      <th>time</th>\n",
       "      <th>date.entered</th>\n",
       "      <th>wk1</th>\n",
       "      <th>wk2</th>\n",
       "      <th>wk3</th>\n",
       "      <th>wk4</th>\n",
       "      <th>wk5</th>\n",
       "      <th>...</th>\n",
       "      <th>wk67</th>\n",
       "      <th>wk68</th>\n",
       "      <th>wk69</th>\n",
       "      <th>wk70</th>\n",
       "      <th>wk71</th>\n",
       "      <th>wk72</th>\n",
       "      <th>wk73</th>\n",
       "      <th>wk74</th>\n",
       "      <th>wk75</th>\n",
       "      <th>wk76</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2000</td>\n",
       "      <td>2 Pac</td>\n",
       "      <td>Baby Don't Cry (Keep...</td>\n",
       "      <td>4:22</td>\n",
       "      <td>2000-02-26</td>\n",
       "      <td>87</td>\n",
       "      <td>82.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2000</td>\n",
       "      <td>2Ge+her</td>\n",
       "      <td>The Hardest Part Of ...</td>\n",
       "      <td>3:15</td>\n",
       "      <td>2000-09-02</td>\n",
       "      <td>91</td>\n",
       "      <td>87.0</td>\n",
       "      <td>92.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2000</td>\n",
       "      <td>3 Doors Down</td>\n",
       "      <td>Kryptonite</td>\n",
       "      <td>3:53</td>\n",
       "      <td>2000-04-08</td>\n",
       "      <td>81</td>\n",
       "      <td>70.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>67.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2000</td>\n",
       "      <td>3 Doors Down</td>\n",
       "      <td>Loser</td>\n",
       "      <td>4:24</td>\n",
       "      <td>2000-10-21</td>\n",
       "      <td>76</td>\n",
       "      <td>76.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>69.0</td>\n",
       "      <td>67.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000</td>\n",
       "      <td>504 Boyz</td>\n",
       "      <td>Wobble Wobble</td>\n",
       "      <td>3:35</td>\n",
       "      <td>2000-04-15</td>\n",
       "      <td>57</td>\n",
       "      <td>34.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 81 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   year        artist                    track  time date.entered  wk1   wk2  \\\n",
       "0  2000         2 Pac  Baby Don't Cry (Keep...  4:22   2000-02-26   87  82.0   \n",
       "1  2000       2Ge+her  The Hardest Part Of ...  3:15   2000-09-02   91  87.0   \n",
       "2  2000  3 Doors Down               Kryptonite  3:53   2000-04-08   81  70.0   \n",
       "3  2000  3 Doors Down                    Loser  4:24   2000-10-21   76  76.0   \n",
       "4  2000      504 Boyz            Wobble Wobble  3:35   2000-04-15   57  34.0   \n",
       "\n",
       "    wk3   wk4   wk5  ...  wk67  wk68  wk69  wk70  wk71  wk72  wk73  wk74  \\\n",
       "0  72.0  77.0  87.0  ...   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   \n",
       "1  92.0   NaN   NaN  ...   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   \n",
       "2  68.0  67.0  66.0  ...   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   \n",
       "3  72.0  69.0  67.0  ...   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   \n",
       "4  25.0  17.0  17.0  ...   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   \n",
       "\n",
       "   wk75  wk76  \n",
       "0   NaN   NaN  \n",
       "1   NaN   NaN  \n",
       "2   NaN   NaN  \n",
       "3   NaN   NaN  \n",
       "4   NaN   NaN  \n",
       "\n",
       "[5 rows x 81 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "billboard.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>artist</th>\n",
       "      <th>track</th>\n",
       "      <th>time</th>\n",
       "      <th>date.entered</th>\n",
       "      <th>week</th>\n",
       "      <th>rank</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2000</td>\n",
       "      <td>2 Pac</td>\n",
       "      <td>Baby Don't Cry (Keep...</td>\n",
       "      <td>4:22</td>\n",
       "      <td>2000-02-26</td>\n",
       "      <td>wk1</td>\n",
       "      <td>87.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2000</td>\n",
       "      <td>2Ge+her</td>\n",
       "      <td>The Hardest Part Of ...</td>\n",
       "      <td>3:15</td>\n",
       "      <td>2000-09-02</td>\n",
       "      <td>wk1</td>\n",
       "      <td>91.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2000</td>\n",
       "      <td>3 Doors Down</td>\n",
       "      <td>Kryptonite</td>\n",
       "      <td>3:53</td>\n",
       "      <td>2000-04-08</td>\n",
       "      <td>wk1</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2000</td>\n",
       "      <td>3 Doors Down</td>\n",
       "      <td>Loser</td>\n",
       "      <td>4:24</td>\n",
       "      <td>2000-10-21</td>\n",
       "      <td>wk1</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000</td>\n",
       "      <td>504 Boyz</td>\n",
       "      <td>Wobble Wobble</td>\n",
       "      <td>3:35</td>\n",
       "      <td>2000-04-15</td>\n",
       "      <td>wk1</td>\n",
       "      <td>57.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2000</td>\n",
       "      <td>98^0</td>\n",
       "      <td>Give Me Just One Nig...</td>\n",
       "      <td>3:24</td>\n",
       "      <td>2000-08-19</td>\n",
       "      <td>wk1</td>\n",
       "      <td>51.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2000</td>\n",
       "      <td>A*Teens</td>\n",
       "      <td>Dancing Queen</td>\n",
       "      <td>3:44</td>\n",
       "      <td>2000-07-08</td>\n",
       "      <td>wk1</td>\n",
       "      <td>97.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2000</td>\n",
       "      <td>Aaliyah</td>\n",
       "      <td>I Don't Wanna</td>\n",
       "      <td>4:15</td>\n",
       "      <td>2000-01-29</td>\n",
       "      <td>wk1</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2000</td>\n",
       "      <td>Aaliyah</td>\n",
       "      <td>Try Again</td>\n",
       "      <td>4:03</td>\n",
       "      <td>2000-03-18</td>\n",
       "      <td>wk1</td>\n",
       "      <td>59.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2000</td>\n",
       "      <td>Adams, Yolanda</td>\n",
       "      <td>Open My Heart</td>\n",
       "      <td>5:30</td>\n",
       "      <td>2000-08-26</td>\n",
       "      <td>wk1</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2000</td>\n",
       "      <td>Adkins, Trace</td>\n",
       "      <td>More</td>\n",
       "      <td>3:05</td>\n",
       "      <td>2000-04-29</td>\n",
       "      <td>wk1</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2000</td>\n",
       "      <td>Aguilera, Christina</td>\n",
       "      <td>Come On Over Baby (A...</td>\n",
       "      <td>3:38</td>\n",
       "      <td>2000-08-05</td>\n",
       "      <td>wk1</td>\n",
       "      <td>57.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2000</td>\n",
       "      <td>Aguilera, Christina</td>\n",
       "      <td>I Turn To You</td>\n",
       "      <td>4:00</td>\n",
       "      <td>2000-04-15</td>\n",
       "      <td>wk1</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2000</td>\n",
       "      <td>Aguilera, Christina</td>\n",
       "      <td>What A Girl Wants</td>\n",
       "      <td>3:18</td>\n",
       "      <td>1999-11-27</td>\n",
       "      <td>wk1</td>\n",
       "      <td>71.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2000</td>\n",
       "      <td>Alice Deejay</td>\n",
       "      <td>Better Off Alone</td>\n",
       "      <td>6:50</td>\n",
       "      <td>2000-04-08</td>\n",
       "      <td>wk1</td>\n",
       "      <td>79.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2000</td>\n",
       "      <td>Allan, Gary</td>\n",
       "      <td>Smoke Rings In The D...</td>\n",
       "      <td>4:18</td>\n",
       "      <td>2000-01-22</td>\n",
       "      <td>wk1</td>\n",
       "      <td>80.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2000</td>\n",
       "      <td>Amber</td>\n",
       "      <td>Sexual</td>\n",
       "      <td>4:38</td>\n",
       "      <td>1999-07-17</td>\n",
       "      <td>wk1</td>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2000</td>\n",
       "      <td>Anastacia</td>\n",
       "      <td>I'm Outta Love</td>\n",
       "      <td>4:01</td>\n",
       "      <td>2000-04-01</td>\n",
       "      <td>wk1</td>\n",
       "      <td>92.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2000</td>\n",
       "      <td>Anthony, Marc</td>\n",
       "      <td>My Baby You</td>\n",
       "      <td>3:59</td>\n",
       "      <td>2000-09-16</td>\n",
       "      <td>wk1</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2000</td>\n",
       "      <td>Anthony, Marc</td>\n",
       "      <td>You Sang To Me</td>\n",
       "      <td>3:50</td>\n",
       "      <td>2000-02-26</td>\n",
       "      <td>wk1</td>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2000</td>\n",
       "      <td>Avant</td>\n",
       "      <td>My First Love</td>\n",
       "      <td>4:28</td>\n",
       "      <td>2000-11-04</td>\n",
       "      <td>wk1</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2000</td>\n",
       "      <td>Avant</td>\n",
       "      <td>Separated</td>\n",
       "      <td>4:13</td>\n",
       "      <td>2000-04-29</td>\n",
       "      <td>wk1</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2000</td>\n",
       "      <td>BBMak</td>\n",
       "      <td>Back Here</td>\n",
       "      <td>3:35</td>\n",
       "      <td>2000-04-29</td>\n",
       "      <td>wk1</td>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2000</td>\n",
       "      <td>Backstreet Boys, The</td>\n",
       "      <td>Shape Of My Heart</td>\n",
       "      <td>3:49</td>\n",
       "      <td>2000-10-14</td>\n",
       "      <td>wk1</td>\n",
       "      <td>39.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2000</td>\n",
       "      <td>Backstreet Boys, The</td>\n",
       "      <td>Show Me The Meaning ...</td>\n",
       "      <td>3:54</td>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>wk1</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2000</td>\n",
       "      <td>Backstreet Boys, The</td>\n",
       "      <td>The One</td>\n",
       "      <td>3:46</td>\n",
       "      <td>2000-05-27</td>\n",
       "      <td>wk1</td>\n",
       "      <td>58.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2000</td>\n",
       "      <td>Badu, Erkyah</td>\n",
       "      <td>Bag Lady</td>\n",
       "      <td>5:03</td>\n",
       "      <td>2000-08-19</td>\n",
       "      <td>wk1</td>\n",
       "      <td>67.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2000</td>\n",
       "      <td>Baha Men</td>\n",
       "      <td>Who Let The Dogs Out</td>\n",
       "      <td>3:17</td>\n",
       "      <td>2000-07-22</td>\n",
       "      <td>wk1</td>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2000</td>\n",
       "      <td>Barenaked Ladies</td>\n",
       "      <td>Pinch Me</td>\n",
       "      <td>3:46</td>\n",
       "      <td>2000-09-09</td>\n",
       "      <td>wk1</td>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2000</td>\n",
       "      <td>Beenie Man</td>\n",
       "      <td>Girls Dem Sugar</td>\n",
       "      <td>4:17</td>\n",
       "      <td>2000-10-21</td>\n",
       "      <td>wk1</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24062</th>\n",
       "      <td>2000</td>\n",
       "      <td>Thomas, Carl</td>\n",
       "      <td>Emotional</td>\n",
       "      <td>4:31</td>\n",
       "      <td>2000-11-25</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24063</th>\n",
       "      <td>2000</td>\n",
       "      <td>Thomas, Carl</td>\n",
       "      <td>I Wish</td>\n",
       "      <td>3:50</td>\n",
       "      <td>2000-03-25</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24064</th>\n",
       "      <td>2000</td>\n",
       "      <td>Thomas, Carl</td>\n",
       "      <td>Summer Rain</td>\n",
       "      <td>4:57</td>\n",
       "      <td>2000-09-23</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24065</th>\n",
       "      <td>2000</td>\n",
       "      <td>Tippin, Aaron</td>\n",
       "      <td>Kiss This</td>\n",
       "      <td>2:53</td>\n",
       "      <td>2000-08-26</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24066</th>\n",
       "      <td>2000</td>\n",
       "      <td>Train</td>\n",
       "      <td>Meet Virginia</td>\n",
       "      <td>3:55</td>\n",
       "      <td>1999-10-09</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24067</th>\n",
       "      <td>2000</td>\n",
       "      <td>Trick Daddy</td>\n",
       "      <td>Shut Up</td>\n",
       "      <td>4:17</td>\n",
       "      <td>2000-05-20</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24068</th>\n",
       "      <td>2000</td>\n",
       "      <td>Trina</td>\n",
       "      <td>Pull Over</td>\n",
       "      <td>2:58</td>\n",
       "      <td>2000-09-09</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24069</th>\n",
       "      <td>2000</td>\n",
       "      <td>Tritt, Travis</td>\n",
       "      <td>Best Of Intentions</td>\n",
       "      <td>4:15</td>\n",
       "      <td>2000-08-19</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24070</th>\n",
       "      <td>2000</td>\n",
       "      <td>Tuesday</td>\n",
       "      <td>I Know</td>\n",
       "      <td>4:06</td>\n",
       "      <td>2000-12-30</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24071</th>\n",
       "      <td>2000</td>\n",
       "      <td>Urban, Keith</td>\n",
       "      <td>Your Everything</td>\n",
       "      <td>4:10</td>\n",
       "      <td>2000-07-15</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24072</th>\n",
       "      <td>2000</td>\n",
       "      <td>Usher</td>\n",
       "      <td>Pop Ya Collar</td>\n",
       "      <td>3:36</td>\n",
       "      <td>2000-11-04</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24073</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vassar, Phil</td>\n",
       "      <td>Carlene</td>\n",
       "      <td>4:07</td>\n",
       "      <td>2000-03-04</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24074</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vassar, Phil</td>\n",
       "      <td>Just Another Day In ...</td>\n",
       "      <td>3:54</td>\n",
       "      <td>2000-09-30</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24075</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vertical Horizon</td>\n",
       "      <td>Everything You Want</td>\n",
       "      <td>4:01</td>\n",
       "      <td>2000-01-22</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24076</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vertical Horizon</td>\n",
       "      <td>You're A God</td>\n",
       "      <td>3:45</td>\n",
       "      <td>2000-08-26</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24077</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vitamin C</td>\n",
       "      <td>Graduation (Friends ...</td>\n",
       "      <td>4:23</td>\n",
       "      <td>2000-04-15</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24078</th>\n",
       "      <td>2000</td>\n",
       "      <td>Vitamin C</td>\n",
       "      <td>The Itch</td>\n",
       "      <td>3:30</td>\n",
       "      <td>2000-12-02</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24079</th>\n",
       "      <td>2000</td>\n",
       "      <td>Walker, Clay</td>\n",
       "      <td>Live, Laugh, Love</td>\n",
       "      <td>4:06</td>\n",
       "      <td>1999-12-04</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24080</th>\n",
       "      <td>2000</td>\n",
       "      <td>Walker, Clay</td>\n",
       "      <td>The Chain Of Love</td>\n",
       "      <td>5:03</td>\n",
       "      <td>2000-04-15</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24081</th>\n",
       "      <td>2000</td>\n",
       "      <td>Wallflowers, The</td>\n",
       "      <td>Sleepwalker</td>\n",
       "      <td>3:29</td>\n",
       "      <td>2000-10-28</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24082</th>\n",
       "      <td>2000</td>\n",
       "      <td>Westlife</td>\n",
       "      <td>Swear It Again</td>\n",
       "      <td>4:07</td>\n",
       "      <td>2000-04-01</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24083</th>\n",
       "      <td>2000</td>\n",
       "      <td>Williams, Robbie</td>\n",
       "      <td>Angels</td>\n",
       "      <td>3:56</td>\n",
       "      <td>1999-11-20</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24084</th>\n",
       "      <td>2000</td>\n",
       "      <td>Wills, Mark</td>\n",
       "      <td>Back At One</td>\n",
       "      <td>4:00</td>\n",
       "      <td>2000-01-15</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24085</th>\n",
       "      <td>2000</td>\n",
       "      <td>Worley, Darryl</td>\n",
       "      <td>When You Need My Lov...</td>\n",
       "      <td>3:35</td>\n",
       "      <td>2000-06-17</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24086</th>\n",
       "      <td>2000</td>\n",
       "      <td>Wright, Chely</td>\n",
       "      <td>It Was</td>\n",
       "      <td>3:51</td>\n",
       "      <td>2000-03-04</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24087</th>\n",
       "      <td>2000</td>\n",
       "      <td>Yankee Grey</td>\n",
       "      <td>Another Nine Minutes</td>\n",
       "      <td>3:10</td>\n",
       "      <td>2000-04-29</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24088</th>\n",
       "      <td>2000</td>\n",
       "      <td>Yearwood, Trisha</td>\n",
       "      <td>Real Live Woman</td>\n",
       "      <td>3:55</td>\n",
       "      <td>2000-04-01</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24089</th>\n",
       "      <td>2000</td>\n",
       "      <td>Ying Yang Twins</td>\n",
       "      <td>Whistle While You Tw...</td>\n",
       "      <td>4:19</td>\n",
       "      <td>2000-03-18</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24090</th>\n",
       "      <td>2000</td>\n",
       "      <td>Zombie Nation</td>\n",
       "      <td>Kernkraft 400</td>\n",
       "      <td>3:30</td>\n",
       "      <td>2000-09-02</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24091</th>\n",
       "      <td>2000</td>\n",
       "      <td>matchbox twenty</td>\n",
       "      <td>Bent</td>\n",
       "      <td>4:12</td>\n",
       "      <td>2000-04-29</td>\n",
       "      <td>wk76</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>24092 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       year                artist                    track  time date.entered  \\\n",
       "0      2000                 2 Pac  Baby Don't Cry (Keep...  4:22   2000-02-26   \n",
       "1      2000               2Ge+her  The Hardest Part Of ...  3:15   2000-09-02   \n",
       "2      2000          3 Doors Down               Kryptonite  3:53   2000-04-08   \n",
       "3      2000          3 Doors Down                    Loser  4:24   2000-10-21   \n",
       "4      2000              504 Boyz            Wobble Wobble  3:35   2000-04-15   \n",
       "5      2000                  98^0  Give Me Just One Nig...  3:24   2000-08-19   \n",
       "6      2000               A*Teens            Dancing Queen  3:44   2000-07-08   \n",
       "7      2000               Aaliyah            I Don't Wanna  4:15   2000-01-29   \n",
       "8      2000               Aaliyah                Try Again  4:03   2000-03-18   \n",
       "9      2000        Adams, Yolanda            Open My Heart  5:30   2000-08-26   \n",
       "10     2000         Adkins, Trace                     More  3:05   2000-04-29   \n",
       "11     2000   Aguilera, Christina  Come On Over Baby (A...  3:38   2000-08-05   \n",
       "12     2000   Aguilera, Christina            I Turn To You  4:00   2000-04-15   \n",
       "13     2000   Aguilera, Christina        What A Girl Wants  3:18   1999-11-27   \n",
       "14     2000          Alice Deejay         Better Off Alone  6:50   2000-04-08   \n",
       "15     2000           Allan, Gary  Smoke Rings In The D...  4:18   2000-01-22   \n",
       "16     2000                 Amber                   Sexual  4:38   1999-07-17   \n",
       "17     2000             Anastacia           I'm Outta Love  4:01   2000-04-01   \n",
       "18     2000         Anthony, Marc              My Baby You  3:59   2000-09-16   \n",
       "19     2000         Anthony, Marc           You Sang To Me  3:50   2000-02-26   \n",
       "20     2000                 Avant            My First Love  4:28   2000-11-04   \n",
       "21     2000                 Avant                Separated  4:13   2000-04-29   \n",
       "22     2000                 BBMak                Back Here  3:35   2000-04-29   \n",
       "23     2000  Backstreet Boys, The        Shape Of My Heart  3:49   2000-10-14   \n",
       "24     2000  Backstreet Boys, The  Show Me The Meaning ...  3:54   2000-01-01   \n",
       "25     2000  Backstreet Boys, The                  The One  3:46   2000-05-27   \n",
       "26     2000          Badu, Erkyah                 Bag Lady  5:03   2000-08-19   \n",
       "27     2000              Baha Men     Who Let The Dogs Out  3:17   2000-07-22   \n",
       "28     2000      Barenaked Ladies                 Pinch Me  3:46   2000-09-09   \n",
       "29     2000            Beenie Man          Girls Dem Sugar  4:17   2000-10-21   \n",
       "...     ...                   ...                      ...   ...          ...   \n",
       "24062  2000          Thomas, Carl                Emotional  4:31   2000-11-25   \n",
       "24063  2000          Thomas, Carl                   I Wish  3:50   2000-03-25   \n",
       "24064  2000          Thomas, Carl              Summer Rain  4:57   2000-09-23   \n",
       "24065  2000         Tippin, Aaron                Kiss This  2:53   2000-08-26   \n",
       "24066  2000                 Train            Meet Virginia  3:55   1999-10-09   \n",
       "24067  2000           Trick Daddy                  Shut Up  4:17   2000-05-20   \n",
       "24068  2000                 Trina                Pull Over  2:58   2000-09-09   \n",
       "24069  2000         Tritt, Travis       Best Of Intentions  4:15   2000-08-19   \n",
       "24070  2000               Tuesday                   I Know  4:06   2000-12-30   \n",
       "24071  2000          Urban, Keith          Your Everything  4:10   2000-07-15   \n",
       "24072  2000                 Usher            Pop Ya Collar  3:36   2000-11-04   \n",
       "24073  2000          Vassar, Phil                  Carlene  4:07   2000-03-04   \n",
       "24074  2000          Vassar, Phil  Just Another Day In ...  3:54   2000-09-30   \n",
       "24075  2000      Vertical Horizon      Everything You Want  4:01   2000-01-22   \n",
       "24076  2000      Vertical Horizon             You're A God  3:45   2000-08-26   \n",
       "24077  2000             Vitamin C  Graduation (Friends ...  4:23   2000-04-15   \n",
       "24078  2000             Vitamin C                 The Itch  3:30   2000-12-02   \n",
       "24079  2000          Walker, Clay        Live, Laugh, Love  4:06   1999-12-04   \n",
       "24080  2000          Walker, Clay        The Chain Of Love  5:03   2000-04-15   \n",
       "24081  2000      Wallflowers, The              Sleepwalker  3:29   2000-10-28   \n",
       "24082  2000              Westlife           Swear It Again  4:07   2000-04-01   \n",
       "24083  2000      Williams, Robbie                   Angels  3:56   1999-11-20   \n",
       "24084  2000           Wills, Mark              Back At One  4:00   2000-01-15   \n",
       "24085  2000        Worley, Darryl  When You Need My Lov...  3:35   2000-06-17   \n",
       "24086  2000         Wright, Chely                   It Was  3:51   2000-03-04   \n",
       "24087  2000           Yankee Grey     Another Nine Minutes  3:10   2000-04-29   \n",
       "24088  2000      Yearwood, Trisha          Real Live Woman  3:55   2000-04-01   \n",
       "24089  2000       Ying Yang Twins  Whistle While You Tw...  4:19   2000-03-18   \n",
       "24090  2000         Zombie Nation            Kernkraft 400  3:30   2000-09-02   \n",
       "24091  2000       matchbox twenty                     Bent  4:12   2000-04-29   \n",
       "\n",
       "       week  rank  \n",
       "0       wk1  87.0  \n",
       "1       wk1  91.0  \n",
       "2       wk1  81.0  \n",
       "3       wk1  76.0  \n",
       "4       wk1  57.0  \n",
       "5       wk1  51.0  \n",
       "6       wk1  97.0  \n",
       "7       wk1  84.0  \n",
       "8       wk1  59.0  \n",
       "9       wk1  76.0  \n",
       "10      wk1  84.0  \n",
       "11      wk1  57.0  \n",
       "12      wk1  50.0  \n",
       "13      wk1  71.0  \n",
       "14      wk1  79.0  \n",
       "15      wk1  80.0  \n",
       "16      wk1  99.0  \n",
       "17      wk1  92.0  \n",
       "18      wk1  82.0  \n",
       "19      wk1  77.0  \n",
       "20      wk1  70.0  \n",
       "21      wk1  62.0  \n",
       "22      wk1  99.0  \n",
       "23      wk1  39.0  \n",
       "24      wk1  74.0  \n",
       "25      wk1  58.0  \n",
       "26      wk1  67.0  \n",
       "27      wk1  99.0  \n",
       "28      wk1  77.0  \n",
       "29      wk1  72.0  \n",
       "...     ...   ...  \n",
       "24062  wk76   NaN  \n",
       "24063  wk76   NaN  \n",
       "24064  wk76   NaN  \n",
       "24065  wk76   NaN  \n",
       "24066  wk76   NaN  \n",
       "24067  wk76   NaN  \n",
       "24068  wk76   NaN  \n",
       "24069  wk76   NaN  \n",
       "24070  wk76   NaN  \n",
       "24071  wk76   NaN  \n",
       "24072  wk76   NaN  \n",
       "24073  wk76   NaN  \n",
       "24074  wk76   NaN  \n",
       "24075  wk76   NaN  \n",
       "24076  wk76   NaN  \n",
       "24077  wk76   NaN  \n",
       "24078  wk76   NaN  \n",
       "24079  wk76   NaN  \n",
       "24080  wk76   NaN  \n",
       "24081  wk76   NaN  \n",
       "24082  wk76   NaN  \n",
       "24083  wk76   NaN  \n",
       "24084  wk76   NaN  \n",
       "24085  wk76   NaN  \n",
       "24086  wk76   NaN  \n",
       "24087  wk76   NaN  \n",
       "24088  wk76   NaN  \n",
       "24089  wk76   NaN  \n",
       "24090  wk76   NaN  \n",
       "24091  wk76   NaN  \n",
       "\n",
       "[24092 rows x 7 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "billboard.melt(id_vars=['year', 'artist', 'track', 'time', 'date.entered'],\n",
    "               value_name='rank',\n",
    "               var_name='week')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "artist\n",
       "2 Pac                   85.428571\n",
       "2Ge+her                 90.000000\n",
       "3 Doors Down            37.602740\n",
       "504 Boyz                56.222222\n",
       "98^0                    37.650000\n",
       "A*Teens                 97.000000\n",
       "Aaliyah                 30.269231\n",
       "Adams, Yolanda          67.750000\n",
       "Adkins, Trace           76.272727\n",
       "Aguilera, Christina     21.089552\n",
       "Alice Deejay            51.250000\n",
       "Allan, Gary             80.600000\n",
       "Amber                   80.275862\n",
       "Anastacia               94.666667\n",
       "Anthony, Marc           46.000000\n",
       "Avant                   40.100000\n",
       "BBMak                   30.645161\n",
       "Backstreet Boys, The    34.474576\n",
       "Badu, Erkyah            32.350000\n",
       "Baha Men                62.500000\n",
       "Barenaked Ladies        33.952381\n",
       "Beenie Man              72.400000\n",
       "Before Dark             87.555556\n",
       "Bega, Lou               78.666667\n",
       "Big Punisher            85.533333\n",
       "Black Rob               62.941176\n",
       "Black, Clint            65.000000\n",
       "Blaque                  21.586207\n",
       "Blige, Mary J.          78.250000\n",
       "Blink-182               33.304348\n",
       "                          ...    \n",
       "Strait, George          52.700000\n",
       "Sugar Ray               58.450000\n",
       "TLC                     63.285714\n",
       "Tamar                   93.666667\n",
       "Tamia                   89.000000\n",
       "Third Eye Blind         44.911765\n",
       "Thomas, Carl            58.627451\n",
       "Tippin, Aaron           66.950000\n",
       "Train                   36.925926\n",
       "Trick Daddy             90.090909\n",
       "Trina                   96.500000\n",
       "Tritt, Travis           47.818182\n",
       "Tuesday                 98.000000\n",
       "Urban, Keith            72.000000\n",
       "Usher                   69.428571\n",
       "Vassar, Phil            61.589744\n",
       "Vertical Horizon        26.709677\n",
       "Vitamin C               60.000000\n",
       "Walker, Clay            72.967742\n",
       "Wallflowers, The        81.000000\n",
       "Westlife                43.350000\n",
       "Williams, Robbie        75.421053\n",
       "Wills, Mark             59.833333\n",
       "Worley, Darryl          85.533333\n",
       "Wright, Chely           77.300000\n",
       "Yankee Grey             83.125000\n",
       "Yearwood, Trisha        84.166667\n",
       "Ying Yang Twins         88.857143\n",
       "Zombie Nation           99.000000\n",
       "matchbox twenty         18.641026\n",
       "Name: rank, Length: 228, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "billboard\n",
    "  .melt(id_vars=['year', 'artist', 'track', 'time', 'date.entered'],\n",
    "        value_name='rank',\n",
    "        var_name='week')\n",
    "  .groupby('artist')['rank']\n",
    "  .mean()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "artist\n",
       "2 Pac                   85.428571\n",
       "2Ge+her                 90.000000\n",
       "3 Doors Down            37.602740\n",
       "504 Boyz                56.222222\n",
       "98^0                    37.650000\n",
       "A*Teens                 97.000000\n",
       "Aaliyah                 30.269231\n",
       "Adams, Yolanda          67.750000\n",
       "Adkins, Trace           76.272727\n",
       "Aguilera, Christina     21.089552\n",
       "Alice Deejay            51.250000\n",
       "Allan, Gary             80.600000\n",
       "Amber                   80.275862\n",
       "Anastacia               94.666667\n",
       "Anthony, Marc           46.000000\n",
       "Avant                   40.100000\n",
       "BBMak                   30.645161\n",
       "Backstreet Boys, The    34.474576\n",
       "Badu, Erkyah            32.350000\n",
       "Baha Men                62.500000\n",
       "Barenaked Ladies        33.952381\n",
       "Beenie Man              72.400000\n",
       "Before Dark             87.555556\n",
       "Bega, Lou               78.666667\n",
       "Big Punisher            85.533333\n",
       "Black Rob               62.941176\n",
       "Black, Clint            65.000000\n",
       "Blaque                  21.586207\n",
       "Blige, Mary J.          78.250000\n",
       "Blink-182               33.304348\n",
       "                          ...    \n",
       "Strait, George          52.700000\n",
       "Sugar Ray               58.450000\n",
       "TLC                     63.285714\n",
       "Tamar                   93.666667\n",
       "Tamia                   89.000000\n",
       "Third Eye Blind         44.911765\n",
       "Thomas, Carl            58.627451\n",
       "Tippin, Aaron           66.950000\n",
       "Train                   36.925926\n",
       "Trick Daddy             90.090909\n",
       "Trina                   96.500000\n",
       "Tritt, Travis           47.818182\n",
       "Tuesday                 98.000000\n",
       "Urban, Keith            72.000000\n",
       "Usher                   69.428571\n",
       "Vassar, Phil            61.589744\n",
       "Vertical Horizon        26.709677\n",
       "Vitamin C               60.000000\n",
       "Walker, Clay            72.967742\n",
       "Wallflowers, The        81.000000\n",
       "Westlife                43.350000\n",
       "Williams, Robbie        75.421053\n",
       "Wills, Mark             59.833333\n",
       "Worley, Darryl          85.533333\n",
       "Wright, Chely           77.300000\n",
       "Yankee Grey             83.125000\n",
       "Yearwood, Trisha        84.166667\n",
       "Ying Yang Twins         88.857143\n",
       "Zombie Nation           99.000000\n",
       "matchbox twenty         18.641026\n",
       "Name: rank, Length: 228, dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "billboard\\\n",
    "  .melt(id_vars=['year', 'artist', 'track', 'time', 'date.entered'],\n",
    "        value_name='rank',\n",
    "        var_name='week')\\\n",
    "  .groupby('artist')['rank']\\\n",
    "  .mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "ebola = pd.read_csv('../data/country_timeseries.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Day</th>\n",
       "      <th>Cases_Guinea</th>\n",
       "      <th>Cases_Liberia</th>\n",
       "      <th>Cases_SierraLeone</th>\n",
       "      <th>Cases_Nigeria</th>\n",
       "      <th>Cases_Senegal</th>\n",
       "      <th>Cases_UnitedStates</th>\n",
       "      <th>Cases_Spain</th>\n",
       "      <th>Cases_Mali</th>\n",
       "      <th>Deaths_Guinea</th>\n",
       "      <th>Deaths_Liberia</th>\n",
       "      <th>Deaths_SierraLeone</th>\n",
       "      <th>Deaths_Nigeria</th>\n",
       "      <th>Deaths_Senegal</th>\n",
       "      <th>Deaths_UnitedStates</th>\n",
       "      <th>Deaths_Spain</th>\n",
       "      <th>Deaths_Mali</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1/5/2015</td>\n",
       "      <td>289</td>\n",
       "      <td>2776.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10030.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1786.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2977.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1/4/2015</td>\n",
       "      <td>288</td>\n",
       "      <td>2775.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9780.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1781.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2943.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1/3/2015</td>\n",
       "      <td>287</td>\n",
       "      <td>2769.0</td>\n",
       "      <td>8166.0</td>\n",
       "      <td>9722.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1767.0</td>\n",
       "      <td>3496.0</td>\n",
       "      <td>2915.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1/2/2015</td>\n",
       "      <td>286</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8157.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3496.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12/31/2014</td>\n",
       "      <td>284</td>\n",
       "      <td>2730.0</td>\n",
       "      <td>8115.0</td>\n",
       "      <td>9633.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1739.0</td>\n",
       "      <td>3471.0</td>\n",
       "      <td>2827.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Date  Day  Cases_Guinea  Cases_Liberia  Cases_SierraLeone  \\\n",
       "0    1/5/2015  289        2776.0            NaN            10030.0   \n",
       "1    1/4/2015  288        2775.0            NaN             9780.0   \n",
       "2    1/3/2015  287        2769.0         8166.0             9722.0   \n",
       "3    1/2/2015  286           NaN         8157.0                NaN   \n",
       "4  12/31/2014  284        2730.0         8115.0             9633.0   \n",
       "\n",
       "   Cases_Nigeria  Cases_Senegal  Cases_UnitedStates  Cases_Spain  Cases_Mali  \\\n",
       "0            NaN            NaN                 NaN          NaN         NaN   \n",
       "1            NaN            NaN                 NaN          NaN         NaN   \n",
       "2            NaN            NaN                 NaN          NaN         NaN   \n",
       "3            NaN            NaN                 NaN          NaN         NaN   \n",
       "4            NaN            NaN                 NaN          NaN         NaN   \n",
       "\n",
       "   Deaths_Guinea  Deaths_Liberia  Deaths_SierraLeone  Deaths_Nigeria  \\\n",
       "0         1786.0             NaN              2977.0             NaN   \n",
       "1         1781.0             NaN              2943.0             NaN   \n",
       "2         1767.0          3496.0              2915.0             NaN   \n",
       "3            NaN          3496.0                 NaN             NaN   \n",
       "4         1739.0          3471.0              2827.0             NaN   \n",
       "\n",
       "   Deaths_Senegal  Deaths_UnitedStates  Deaths_Spain  Deaths_Mali  \n",
       "0             NaN                  NaN           NaN          NaN  \n",
       "1             NaN                  NaN           NaN          NaN  \n",
       "2             NaN                  NaN           NaN          NaN  \n",
       "3             NaN                  NaN           NaN          NaN  \n",
       "4             NaN                  NaN           NaN          NaN  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ebola.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "ebola_long = ebola.melt(id_vars=['Date', 'Day'],\n",
    "                       var_name='cd_country',\n",
    "                       value_name='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Day</th>\n",
       "      <th>cd_country</th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1/5/2015</td>\n",
       "      <td>289</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2776.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1/4/2015</td>\n",
       "      <td>288</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2775.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1/3/2015</td>\n",
       "      <td>287</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2769.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1/2/2015</td>\n",
       "      <td>286</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12/31/2014</td>\n",
       "      <td>284</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2730.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Date  Day    cd_country   count\n",
       "0    1/5/2015  289  Cases_Guinea  2776.0\n",
       "1    1/4/2015  288  Cases_Guinea  2775.0\n",
       "2    1/3/2015  287  Cases_Guinea  2769.0\n",
       "3    1/2/2015  286  Cases_Guinea     NaN\n",
       "4  12/31/2014  284  Cases_Guinea  2730.0"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ebola_long.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['hello', 'world']"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'hello_world'.split('_')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "ebola_split = ebola_long['cd_country'].str.split('_', expand=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "ebola_long['test'] = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Day</th>\n",
       "      <th>cd_country</th>\n",
       "      <th>count</th>\n",
       "      <th>test</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1/5/2015</td>\n",
       "      <td>289</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2776.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1/4/2015</td>\n",
       "      <td>288</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2775.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1/3/2015</td>\n",
       "      <td>287</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2769.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1/2/2015</td>\n",
       "      <td>286</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12/31/2014</td>\n",
       "      <td>284</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2730.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Date  Day    cd_country   count  test\n",
       "0    1/5/2015  289  Cases_Guinea  2776.0     1\n",
       "1    1/4/2015  288  Cases_Guinea  2775.0     1\n",
       "2    1/3/2015  287  Cases_Guinea  2769.0     1\n",
       "3    1/2/2015  286  Cases_Guinea     NaN     1\n",
       "4  12/31/2014  284  Cases_Guinea  2730.0     1"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ebola_long.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "ebola_long[['status', 'country']] = ebola_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Date</th>\n",
       "      <th>Day</th>\n",
       "      <th>cd_country</th>\n",
       "      <th>count</th>\n",
       "      <th>test</th>\n",
       "      <th>status</th>\n",
       "      <th>country</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1/5/2015</td>\n",
       "      <td>289</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2776.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cases</td>\n",
       "      <td>Guinea</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1/4/2015</td>\n",
       "      <td>288</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2775.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cases</td>\n",
       "      <td>Guinea</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1/3/2015</td>\n",
       "      <td>287</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2769.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cases</td>\n",
       "      <td>Guinea</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1/2/2015</td>\n",
       "      <td>286</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cases</td>\n",
       "      <td>Guinea</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12/31/2014</td>\n",
       "      <td>284</td>\n",
       "      <td>Cases_Guinea</td>\n",
       "      <td>2730.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cases</td>\n",
       "      <td>Guinea</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Date  Day    cd_country   count  test status country\n",
       "0    1/5/2015  289  Cases_Guinea  2776.0     1  Cases  Guinea\n",
       "1    1/4/2015  288  Cases_Guinea  2775.0     1  Cases  Guinea\n",
       "2    1/3/2015  287  Cases_Guinea  2769.0     1  Cases  Guinea\n",
       "3    1/2/2015  286  Cases_Guinea     NaN     1  Cases  Guinea\n",
       "4  12/31/2014  284  Cases_Guinea  2730.0     1  Cases  Guinea"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ebola_long.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "weather = pd.read_csv('../data/weather.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>element</th>\n",
       "      <th>d1</th>\n",
       "      <th>d2</th>\n",
       "      <th>d3</th>\n",
       "      <th>d4</th>\n",
       "      <th>d5</th>\n",
       "      <th>d6</th>\n",
       "      <th>...</th>\n",
       "      <th>d22</th>\n",
       "      <th>d23</th>\n",
       "      <th>d24</th>\n",
       "      <th>d25</th>\n",
       "      <th>d26</th>\n",
       "      <th>d27</th>\n",
       "      <th>d28</th>\n",
       "      <th>d29</th>\n",
       "      <th>d30</th>\n",
       "      <th>d31</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>1</td>\n",
       "      <td>tmax</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27.8</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>1</td>\n",
       "      <td>tmin</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>14.5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>tmax</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27.3</td>\n",
       "      <td>24.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>29.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>tmin</td>\n",
       "      <td>NaN</td>\n",
       "      <td>14.4</td>\n",
       "      <td>14.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>3</td>\n",
       "      <td>tmax</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>32.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        id  year  month element  d1    d2    d3  d4    d5  d6  ...  d22   d23  \\\n",
       "0  MX17004  2010      1    tmax NaN   NaN   NaN NaN   NaN NaN  ...  NaN   NaN   \n",
       "1  MX17004  2010      1    tmin NaN   NaN   NaN NaN   NaN NaN  ...  NaN   NaN   \n",
       "2  MX17004  2010      2    tmax NaN  27.3  24.1 NaN   NaN NaN  ...  NaN  29.9   \n",
       "3  MX17004  2010      2    tmin NaN  14.4  14.4 NaN   NaN NaN  ...  NaN  10.7   \n",
       "4  MX17004  2010      3    tmax NaN   NaN   NaN NaN  32.1 NaN  ...  NaN   NaN   \n",
       "\n",
       "   d24  d25  d26  d27  d28  d29   d30  d31  \n",
       "0  NaN  NaN  NaN  NaN  NaN  NaN  27.8  NaN  \n",
       "1  NaN  NaN  NaN  NaN  NaN  NaN  14.5  NaN  \n",
       "2  NaN  NaN  NaN  NaN  NaN  NaN   NaN  NaN  \n",
       "3  NaN  NaN  NaN  NaN  NaN  NaN   NaN  NaN  \n",
       "4  NaN  NaN  NaN  NaN  NaN  NaN   NaN  NaN  \n",
       "\n",
       "[5 rows x 35 columns]"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weather.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "weather_long = weather.melt(id_vars=['id', 'year', 'month', 'element'],\n",
    "                            var_name='day',\n",
    "                            value_name='temp')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>element</th>\n",
       "      <th>day</th>\n",
       "      <th>temp</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>1</td>\n",
       "      <td>tmax</td>\n",
       "      <td>d1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>1</td>\n",
       "      <td>tmin</td>\n",
       "      <td>d1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>tmax</td>\n",
       "      <td>d1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>tmin</td>\n",
       "      <td>d1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>3</td>\n",
       "      <td>tmax</td>\n",
       "      <td>d1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        id  year  month element day  temp\n",
       "0  MX17004  2010      1    tmax  d1   NaN\n",
       "1  MX17004  2010      1    tmin  d1   NaN\n",
       "2  MX17004  2010      2    tmax  d1   NaN\n",
       "3  MX17004  2010      2    tmin  d1   NaN\n",
       "4  MX17004  2010      3    tmax  d1   NaN"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weather_long.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>element</th>\n",
       "      <th>id</th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "      <th>tmax</th>\n",
       "      <th>tmin</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>1</td>\n",
       "      <td>d30</td>\n",
       "      <td>27.8</td>\n",
       "      <td>14.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>d11</td>\n",
       "      <td>29.7</td>\n",
       "      <td>13.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>d2</td>\n",
       "      <td>27.3</td>\n",
       "      <td>14.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>d23</td>\n",
       "      <td>29.9</td>\n",
       "      <td>10.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>2</td>\n",
       "      <td>d3</td>\n",
       "      <td>24.1</td>\n",
       "      <td>14.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>3</td>\n",
       "      <td>d10</td>\n",
       "      <td>34.5</td>\n",
       "      <td>16.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>3</td>\n",
       "      <td>d16</td>\n",
       "      <td>31.1</td>\n",
       "      <td>17.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>3</td>\n",
       "      <td>d5</td>\n",
       "      <td>32.1</td>\n",
       "      <td>14.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>4</td>\n",
       "      <td>d27</td>\n",
       "      <td>36.3</td>\n",
       "      <td>16.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>5</td>\n",
       "      <td>d27</td>\n",
       "      <td>33.2</td>\n",
       "      <td>18.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>6</td>\n",
       "      <td>d17</td>\n",
       "      <td>28.0</td>\n",
       "      <td>17.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>6</td>\n",
       "      <td>d29</td>\n",
       "      <td>30.1</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>7</td>\n",
       "      <td>d3</td>\n",
       "      <td>28.6</td>\n",
       "      <td>17.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>7</td>\n",
       "      <td>d14</td>\n",
       "      <td>29.9</td>\n",
       "      <td>16.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d23</td>\n",
       "      <td>26.4</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d5</td>\n",
       "      <td>29.6</td>\n",
       "      <td>15.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d29</td>\n",
       "      <td>28.0</td>\n",
       "      <td>15.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d13</td>\n",
       "      <td>29.8</td>\n",
       "      <td>16.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d25</td>\n",
       "      <td>29.7</td>\n",
       "      <td>15.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d31</td>\n",
       "      <td>25.4</td>\n",
       "      <td>15.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>8</td>\n",
       "      <td>d8</td>\n",
       "      <td>29.0</td>\n",
       "      <td>17.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>10</td>\n",
       "      <td>d5</td>\n",
       "      <td>27.0</td>\n",
       "      <td>14.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>10</td>\n",
       "      <td>d14</td>\n",
       "      <td>29.5</td>\n",
       "      <td>13.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>10</td>\n",
       "      <td>d15</td>\n",
       "      <td>28.7</td>\n",
       "      <td>10.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>10</td>\n",
       "      <td>d28</td>\n",
       "      <td>31.2</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>10</td>\n",
       "      <td>d7</td>\n",
       "      <td>28.1</td>\n",
       "      <td>12.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>11</td>\n",
       "      <td>d2</td>\n",
       "      <td>31.3</td>\n",
       "      <td>16.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>11</td>\n",
       "      <td>d5</td>\n",
       "      <td>26.3</td>\n",
       "      <td>7.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>11</td>\n",
       "      <td>d27</td>\n",
       "      <td>27.7</td>\n",
       "      <td>14.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>11</td>\n",
       "      <td>d26</td>\n",
       "      <td>28.1</td>\n",
       "      <td>12.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>11</td>\n",
       "      <td>d4</td>\n",
       "      <td>27.2</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>12</td>\n",
       "      <td>d1</td>\n",
       "      <td>29.9</td>\n",
       "      <td>13.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>MX17004</td>\n",
       "      <td>2010</td>\n",
       "      <td>12</td>\n",
       "      <td>d6</td>\n",
       "      <td>27.8</td>\n",
       "      <td>10.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "element       id  year  month  day  tmax  tmin\n",
       "0        MX17004  2010      1  d30  27.8  14.5\n",
       "1        MX17004  2010      2  d11  29.7  13.4\n",
       "2        MX17004  2010      2   d2  27.3  14.4\n",
       "3        MX17004  2010      2  d23  29.9  10.7\n",
       "4        MX17004  2010      2   d3  24.1  14.4\n",
       "5        MX17004  2010      3  d10  34.5  16.8\n",
       "6        MX17004  2010      3  d16  31.1  17.6\n",
       "7        MX17004  2010      3   d5  32.1  14.2\n",
       "8        MX17004  2010      4  d27  36.3  16.7\n",
       "9        MX17004  2010      5  d27  33.2  18.2\n",
       "10       MX17004  2010      6  d17  28.0  17.5\n",
       "11       MX17004  2010      6  d29  30.1  18.0\n",
       "12       MX17004  2010      7   d3  28.6  17.5\n",
       "13       MX17004  2010      7  d14  29.9  16.5\n",
       "14       MX17004  2010      8  d23  26.4  15.0\n",
       "15       MX17004  2010      8   d5  29.6  15.8\n",
       "16       MX17004  2010      8  d29  28.0  15.3\n",
       "17       MX17004  2010      8  d13  29.8  16.5\n",
       "18       MX17004  2010      8  d25  29.7  15.6\n",
       "19       MX17004  2010      8  d31  25.4  15.4\n",
       "20       MX17004  2010      8   d8  29.0  17.3\n",
       "21       MX17004  2010     10   d5  27.0  14.0\n",
       "22       MX17004  2010     10  d14  29.5  13.0\n",
       "23       MX17004  2010     10  d15  28.7  10.5\n",
       "24       MX17004  2010     10  d28  31.2  15.0\n",
       "25       MX17004  2010     10   d7  28.1  12.9\n",
       "26       MX17004  2010     11   d2  31.3  16.3\n",
       "27       MX17004  2010     11   d5  26.3   7.9\n",
       "28       MX17004  2010     11  d27  27.7  14.2\n",
       "29       MX17004  2010     11  d26  28.1  12.1\n",
       "30       MX17004  2010     11   d4  27.2  12.0\n",
       "31       MX17004  2010     12   d1  29.9  13.8\n",
       "32       MX17004  2010     12   d6  27.8  10.5"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(weather_long.pivot_table(index=['id', 'year', 'month', 'day'],\n",
    "                         columns='element',\n",
    "                         values='temp')\n",
    ".reset_index()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10000000000000"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10_000_000_000_000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[1,\n",
    " 2,\n",
    " 3,\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
